@extends('backend.template.bootstrap')
@section('content')
<div class="m-b-md">
	<h3 class="m-b-none">章节详情</h3>
</div>
<div class="row">
	<div class="col-lg-12">
		<ul class="breadcrumb">
			<li><a href="{{ url('backend') }}"><i class="fa fa-home"></i> 首页</a></li>
			<li><a href="{{ url('backend/books') }}">小说管理</a></li>
			<li><a href="{{ url('backend/books/'.$book->id.'/sections') }}">小说章节</a></li>
			<li class="active">{{ $section->name }}</li>
		</ul>
	</div>
</div>
<div class="panel panel-default">
	<header class="panel-heading">小说详情</header>
	<table class="table table-striped b-t b-light table-middle">
		<thead>
			<tr>
				<th colspan="2" class="text-center">小说名称</th>
				<th class="text-center" width="120">作者</th>
				<th>简介</th>
				<th>标签</th>
				<th class="text-center">字数</th>
				<th class="text-center">状态</th>
				<th class="text-center">最后更新</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td width="120">
					{{ $book->name }} <br />
					@if(is_null($book->category_id))
					[ {{ $book->old_category }} ]
					@else
					[ {{ $book->category->name }} ]
					@endif
				</td>
				<td width="120">
					<img alt="" src="{{ $book->thumbnailUrl() }}"  width="99" height="124" >
				</td>
				<td>
					{{ $book->author }}
				</td>
				<td>
					{!! $book->abstract !!}
				</td>
				<td width="120">
					{{ $book->tags }}
				</td>
				<td width="80">
					{{ $book->font_num }}
				</td>
				<td width="80">
					{{ $book->status }}
				</td>
				<td class="text-center" width="120">{{ $book->updated_at->format('Y-m-d h:i:s') }}</td>
			</tr>
		</tbody>
	</table>
</div>
<div class="panel panel-default">
	<div class="panel-heading">
		{{ $section->name }}
	</div>
	<div style="padding: 20px;">{!! $section->content !!}</div>
</div>
<div class="panel panel-default">
	<div class="panel-heading text-center">
		<a class="btn btn-success btn-lg" href="{{ url('backend/books/'.$book->id.'/sections/'.$section->preSection(true)) }}">上一章</a>
		<a class="btn btn-default btn-lg" href="{{ url('backend/books/'.$book->id.'/sections/'.$section->id.'/edit') }}">编辑</a>
		<a class="btn btn-success btn-lg" href="{{ url('backend/books/'.$book->id.'/sections/'.$section->nextSection(true)) }}">下一章</a>
	</div>
</div>
@endsection